package com.example.demo.controller;

import com.example.demo.common.Result;
import com.example.demo.entity.SysTask;
import com.example.demo.service.impl.SysTaskServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wzz
 * @since 2023-11-07
 */
@RestController
@RequestMapping("/sysTask")
public class SysTaskController {

    @Resource
    private SysTaskServiceImpl sysTaskService;


    @GetMapping("/")
    public Result getTaskList(){
       return Result.success(sysTaskService.list());
    }

    @PostMapping("/add")
    public Result addTask(@RequestBody SysTask sysTask){
       System.out.println(sysTask);
        return Result.success(sysTaskService.save(sysTask));
    }

}
